<?php
/* @var $this DefaultController */
/* @var $model Khachhang */

$this->breadcrumbs=array(
	'Thành viên'=>array('admin'),
	'Manage',
);
?>
<div class="col-md-12">
    <div class="box box-primary">
        <div class="box-header">
            <h1 class="box-title">Quản lý thành viên</h1>
            <div class="pull-right top5" style="margin: 8px 9px;">
			    <a style="color:#fff;" href="<?php echo Yii::app()->createUrl('/KhachHang/default/create'); ?>" class="btn btn-primary">Thêm mới thành viên</a>
			 </div>
        </div><!-- /.box-header -->
        <div class="box-body">
           
			<?php $this->widget('ext.GLGridView', array(
				'id'=>'doitac-grid',
				'dataProvider'=>$model->search(),
				'filter'=>$model,
				'cssFile' => Yii::app()->theme->baseUrl . '/css/gridView.css',
				'columns'=>array(
					'id',
					array(
						'name'=>'ten',
						'htmlOptions'=>array('class'=>'name-ten'),
					),
					array(
						'name'=>'ma_so',
						'htmlOptions'=>array('class'=>'ma-khachhang'),
					),
					'cmnd',
					'dien_thoai',
					'email',
					'dia_chi',
					array(
						'name'=>'duoc_chiet_khau',
						'value'=>'getMoney($data->duoc_chiet_khau)',
						'htmlOptions'=>array('class'=>'tongchietkhau'),
					),
					array(
						'name'=>'da_thanh_toan',
						'value'=>'getMoney($data->da_thanh_toan)',
						'htmlOptions'=>array('class'=>'da-thanhtoan'),
					),
					array(
						'name'=>'chua_thanh_toan',
						'value'=>'getMoney($data->chua_thanh_toan)',
						'htmlOptions'=>array('class'=>'chua-thanhtoan'),
					),
					/*
					'ma_so',
					'tong_tieu_dung',
					'duoc_chiet_khau',
					'da_thanh_toan',
					'chua_thanh_toan',
					*/
					array(
						'class'=>'CButtonColumn',
						'template' => ' {view} {update}',
					),
				),
			)); ?>
        </div><!-- /.box-body -->
    </div><!-- /.box -->
</div>
<style type="text/css">
	.box .box-body .table {
		margin-bottom: 27px;
		}
		a.view{display: none;}
		a.update img{
			width: 20px;
		}
		.grid-view tbody tr{
			cursor: pointer;
		}
</style>
<script type="text/javascript">
	$(".grid-view tbody tr").live("click", function(){
	  window.location.href = $(this).find(".view").attr("href");
	});
</script>